package com.itheima;

import java.util.Random;

/*
    抽奖
 */
public class ArrayDemo11 {
    public static void main(String[] args) {
        int[] arr = {2,588,888,1000,10000};
        Random r = new Random();
        int index = 0;
        int count = 0;
        lo:
        for (int i = 0; true; i++) {
            while (true) {
                index = r.nextInt(arr.length);
                if (arr[index] == 0) {
                    break;
                } else if (arr[index] != 0) {
                    System.out.println(arr[index] + "元的奖金被抽出");
                    arr[index] = 0;
                    count++;
                } else if (count == arr.length) {
                    break lo;
                }
            }
        }
    }
}
